
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-form" lay-filter="user-set-password-form" id="user-set-password-form" style="padding: 20px 30px 0 0;">

                        <div class="layui-form-item">
                            <label class="layui-form-label">旧密码</label>
                            <div class="layui-input-block">
                                <input type="password" name="oldPassword" placeholder="" lay-verify="required" minlen="6" maxlen="20" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">新密码</label>
                            <div class="layui-input-block">
                                <input type="password" name="newPassword" placeholder="" lay-verify="required" regular="^.*(?=.{8,20})(?=.*\d)(?=.*[A-Z])(?=.*[a-z]).*$" regularMsg="密码强度不符合要求,必须包含大小写字母和数字" regularMsg_EN="Password strength does not meet the requirements, must contain upper and lower case letters and numbers." minlen="8" maxlen="20" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">确认新密码</label>
                            <div class="layui-input-block">
                                <input type="password" name="checkPassword" placeholder="" lay-verify="required" regular="^.*(?=.{8,20})(?=.*\d)(?=.*[A-Z])(?=.*[a-z]).*$" regularMsg="密码强度不符合要求,必须包含大小写字母和数字" regularMsg_EN="Password strength does not meet the requirements, must contain upper and lower case letters and numbers." minlen="8" maxlen="20" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"></label>
                            <div class="layui-input-inline">
                                <input type="button" lay-submit lay-filter="user-set-password-form-submit" value="确认" class="layui-btn layui-btn-default">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
 
    layui.use('reForm', function () {
        var $ = layui.$
            , reForm = layui.reForm
            , view = layui.view
            , admin = layui.admin;
        //reForm.setFormLang('user-set-password-form');
        reForm.initForm({
            formLay: 'user-set-password-form'
            , subUrl: '/Admin/updateUserPassword'
            , verify: function (data) {
                debugger
                return
                if (data.newPassword == data.oldPassword)
                    return view.warn(admin.lang ? 'The new password is the same as the old one. Please change it.' : '新密码与旧密码相同，请修改。'), false;


                if (data.newPassword != data.checkPassword)
                    return view.warn(admin.lang ? 'The two passwords are inconsistent.' : '两次密码不一致。'), false;

            }
        })
    })
</script>